package com.example.statistics.bean

import com.example.statistics.ex.IDialogModel
import java.io.Serializable

data class Bank(
    var ID: Int = 0,
    var bank: String = "",//账户
    var balance: Double = 0.0,//余额
    var accountName: String = "",
    var openingBank: String = "",
    var cardNumber: String = "",
    var remark: String = ""
) : IDialogModel {
    override val itemName: String
        get() {
            var numberString = ""
            if (cardNumber.length > 4) {
                val number = cardNumber.replace(" ", "")
                numberString = number.substring(number.length - 4, number.length)
            }
            return bank + numberString
        }
}

/**
 * 银行流水
 */
data class BankFlowBean(
    var ID: Int,
    var date: String,
    var time: String,
    var accountId: Int,
    var customerId: Int,
    var customer: String,
    var account: String,//账户
    var money: Double,//金额
    var balance: Double,
    var type: String,
    var remark: String
) : Serializable

/**
 * 银行流水对应的账单
 */
data class StatementBean(
    var ID: Int,
    var bankStatementId: Int,//银行流水id
    var type: String,//收入、支出
    var money: Double,//明细金额
    var bankStatementMoney: Double,//流水总金额
    var function: String, //使用模块
    var functionId: Int,
    var bank: String,
    var accountName: String,
    var cardNumber: String,
    var date: String
) : Serializable

data class AdjustmentBean(
    var ID: Int,
    var date: String,
    var time: String,
    var money: Double,
    var paymentAccount: String,
    var paymentAccountId: Int,
    var collectionAccount: String,
    var collectionAccountId: Int,
    var remark: String
)

/**
 * 一般费用
 */
data class IncomeExpenseBean(
    var ID: Int,
    var date: String,
    var type: String,
    var purpose: String,
    var money: Double,
    var balance: Double,
    var remark: String,
    var statementList: List<BankFlowBean>
) : Serializable

